<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: GamedayFetcher</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">GamedayFetcher</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../files/lib/gameday_fetcher_rb.html">
                lib/gameday_fetcher.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                Object
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">

    <div id="description">
      <p>
This class is responsible for retrieving the <a
href="Gameday.html">Gameday</a> files. It uses either a remote or a local
<a href="GamedayFetcher.html#M000021">fetcher</a> to get the files from a
remote server or the local file system.
</p>
<p>
The files that can be fetched using this class:
</p>
<pre>
    THESE FILES ARE ASSOCIATED WITH A SPECIFIC DATE
    epg.xml
    master_scoreboard.xml
    media/highlights.xml

    HTML PAGES THAT CAN BE RETRIEVED
    games page =&gt; this page lists all games for the selected date
    batters page =&gt; this page lists all batter files for the selected game
    pitchers page =&gt; this page lists all pitcher files for the selected game

    FILES THAT ARE ASSOCIATED WITH A SPECIFIC GAME IDENTIFIED BY A GID  ##############
    bench.xml
    benchO.xml
    boxscore.xml
    emailSource.xml
    eventLog.xml
    game.xml
    game_events.xml
    gamecenter.xml
    gameday_Syn.xml
    linescore.xml
    miniscoreboard.xml
    players.xml
    plays.xml

    batters/(pid).xml
    pitchers/(pid).xml

    inning/inning_X.xml
    inning/inning_Scores.xml
    inning/inning_hit.xml

    onbase/linescore.xml
    onbase/plays.xml

    media/highlights.xml
    media/mobile.xml

    notifications/notifications_X.xml where X is an inning number
    notifications/notifications_full.xml
</pre>

    </div>


   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000038">fetch_batter</a>&nbsp;&nbsp;
      <a href="#M000044">fetch_batters_page</a>&nbsp;&nbsp;
      <a href="#M000025">fetch_bench</a>&nbsp;&nbsp;
      <a href="#M000026">fetch_bencho</a>&nbsp;&nbsp;
      <a href="#M000027">fetch_boxscore</a>&nbsp;&nbsp;
      <a href="#M000024">fetch_day_highlights</a>&nbsp;&nbsp;
      <a href="#M000028">fetch_emailsource</a>&nbsp;&nbsp;
      <a href="#M000022">fetch_epg</a>&nbsp;&nbsp;
      <a href="#M000029">fetch_eventlog</a>&nbsp;&nbsp;
      <a href="#M000031">fetch_game_events</a>&nbsp;&nbsp;
      <a href="#M000030">fetch_game_xml</a>&nbsp;&nbsp;
      <a href="#M000032">fetch_gamecenter_xml</a>&nbsp;&nbsp;
      <a href="#M000033">fetch_gamedaysyn</a>&nbsp;&nbsp;
      <a href="#M000043">fetch_games_page</a>&nbsp;&nbsp;
      <a href="#M000042">fetch_inning_hit</a>&nbsp;&nbsp;
      <a href="#M000041">fetch_inning_scores</a>&nbsp;&nbsp;
      <a href="#M000040">fetch_inningx</a>&nbsp;&nbsp;
      <a href="#M000034">fetch_linescore</a>&nbsp;&nbsp;
      <a href="#M000046">fetch_media_highlights</a>&nbsp;&nbsp;
      <a href="#M000047">fetch_media_mobile</a>&nbsp;&nbsp;
      <a href="#M000035">fetch_miniscoreboard</a>&nbsp;&nbsp;
      <a href="#M000051">fetch_notifications_full</a>&nbsp;&nbsp;
      <a href="#M000050">fetch_notifications_inning</a>&nbsp;&nbsp;
      <a href="#M000048">fetch_onbase_linescore</a>&nbsp;&nbsp;
      <a href="#M000049">fetch_onbase_plays</a>&nbsp;&nbsp;
      <a href="#M000039">fetch_pitcher</a>&nbsp;&nbsp;
      <a href="#M000045">fetch_pitchers_page</a>&nbsp;&nbsp;
      <a href="#M000036">fetch_players</a>&nbsp;&nbsp;
      <a href="#M000037">fetch_plays</a>&nbsp;&nbsp;
      <a href="#M000023">fetch_scoreboard</a>&nbsp;&nbsp;
      <a href="#M000021">fetcher</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000038" class="method-detail">
        <a name="M000038"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000038.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000038.html');return false;">
          <span class="method-name">fetch_batter</span><span class="method-args">(gid, pid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the batters/(pid).xml file
</p>
        </div>
      </div>

      <div id="method-M000044" class="method-detail">
        <a name="M000044"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000044.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000044.html');return false;">
          <span class="method-name">fetch_batters_page</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the HTML page that lists all games for the specified date
</p>
        </div>
      </div>

      <div id="method-M000025" class="method-detail">
        <a name="M000025"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000025.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000025.html');return false;">
          <span class="method-name">fetch_bench</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the bench.xml file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/bench.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/bench.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000026" class="method-detail">
        <a name="M000026"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000026.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000026.html');return false;">
          <span class="method-name">fetch_bencho</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the benchO.xml file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/benchO.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/benchO.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000027" class="method-detail">
        <a name="M000027"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000027.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000027.html');return false;">
          <span class="method-name">fetch_boxscore</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the boxscore.xml file and returns its contents Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2009/month_05/day_08/gid_2009_05_08_detmlb_clemlb_1/boxscore.xml">gd2.mlb.com/components/game/mlb/year_2009/month_05/day_08/gid_2009_05_08_detmlb_clemlb_1/boxscore.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000024" class="method-detail">
        <a name="M000024"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000024.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000024.html');return false;">
          <span class="method-name">fetch_day_highlights</span><span class="method-args">(year, month, day)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000028" class="method-detail">
        <a name="M000028"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000028.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000028.html');return false;">
          <span class="method-name">fetch_emailsource</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the emailSource.xml file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/emailSource.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/emailSource.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000022" class="method-detail">
        <a name="M000022"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000022.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000022.html');return false;">
          <span class="method-name">fetch_epg</span><span class="method-args">(year, month, day)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000029" class="method-detail">
        <a name="M000029"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000029.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000029.html');return false;">
          <span class="method-name">fetch_eventlog</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the eventLog.xml file and returns its contents Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_flomlb_wasmlb_1/eventLog.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_flomlb_wasmlb_1/eventLog.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000031" class="method-detail">
        <a name="M000031"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000031.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000031.html');return false;">
          <span class="method-name">fetch_game_events</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000030" class="method-detail">
        <a name="M000030"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000030.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000030.html');return false;">
          <span class="method-name">fetch_game_xml</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the game.xml file and returns its contents
</p>
        </div>
      </div>

      <div id="method-M000032" class="method-detail">
        <a name="M000032"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000032.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000032.html');return false;">
          <span class="method-name">fetch_gamecenter_xml</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the gamecenter.xml file and returns its contents
</p>
        </div>
      </div>

      <div id="method-M000033" class="method-detail">
        <a name="M000033"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000033.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000033.html');return false;">
          <span class="method-name">fetch_gamedaysyn</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the gameday_Syn.xml file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/gameday_Syn.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/gameday_Syn.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000043" class="method-detail">
        <a name="M000043"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000043.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000043.html');return false;">
          <span class="method-name">fetch_games_page</span><span class="method-args">(year, month, day)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the HTML page that lists all games for the specified date
</p>
        </div>
      </div>

      <div id="method-M000042" class="method-detail">
        <a name="M000042"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000042.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000042.html');return false;">
          <span class="method-name">fetch_inning_hit</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
inning/inning_hit.xml
</p>
        </div>
      </div>

      <div id="method-M000041" class="method-detail">
        <a name="M000041"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000041.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000041.html');return false;">
          <span class="method-name">fetch_inning_scores</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
inning/inning_Score.xml
</p>
        </div>
      </div>

      <div id="method-M000040" class="method-detail">
        <a name="M000040"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000040.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000040.html');return false;">
          <span class="method-name">fetch_inningx</span><span class="method-args">(gid, inning_num)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
inning/inning_X.xml
</p>
        </div>
      </div>

      <div id="method-M000034" class="method-detail">
        <a name="M000034"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000034.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000034.html');return false;">
          <span class="method-name">fetch_linescore</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the linescore.xml file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/linescore.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/linescore.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000046" class="method-detail">
        <a name="M000046"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000046.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000046.html');return false;">
          <span class="method-name">fetch_media_highlights</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000047" class="method-detail">
        <a name="M000047"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000047.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000047.html');return false;">
          <span class="method-name">fetch_media_mobile</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000035" class="method-detail">
        <a name="M000035"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000035.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000035.html');return false;">
          <span class="method-name">fetch_miniscoreboard</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the miniscoreboard.xml file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/miniscoreboard.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/miniscoreboard.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000051" class="method-detail">
        <a name="M000051"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000051.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000051.html');return false;">
          <span class="method-name">fetch_notifications_full</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000050" class="method-detail">
        <a name="M000050"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000050.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000050.html');return false;">
          <span class="method-name">fetch_notifications_inning</span><span class="method-args">(gid, inning)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000048" class="method-detail">
        <a name="M000048"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000048.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000048.html');return false;">
          <span class="method-name">fetch_onbase_linescore</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000049" class="method-detail">
        <a name="M000049"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000049.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000049.html');return false;">
          <span class="method-name">fetch_onbase_plays</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
        </div>
      </div>

      <div id="method-M000039" class="method-detail">
        <a name="M000039"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000039.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000039.html');return false;">
          <span class="method-name">fetch_pitcher</span><span class="method-args">(gid, pid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the pitchers/(pid).xml file
</p>
        </div>
      </div>

      <div id="method-M000045" class="method-detail">
        <a name="M000045"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000045.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000045.html');return false;">
          <span class="method-name">fetch_pitchers_page</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the HTML page that lists all games for the specified date
</p>
        </div>
      </div>

      <div id="method-M000036" class="method-detail">
        <a name="M000036"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000036.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000036.html');return false;">
          <span class="method-name">fetch_players</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetches the players.xml file and returns its contents
</p>
        </div>
      </div>

      <div id="method-M000037" class="method-detail">
        <a name="M000037"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000037.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000037.html');return false;">
          <span class="method-name">fetch_plays</span><span class="method-args">(gid)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the plays.xml file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/plays.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/gid_2008_04_07_atlmlb_colmlb_1/plays.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000023" class="method-detail">
        <a name="M000023"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000023.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000023.html');return false;">
          <span class="method-name">fetch_scoreboard</span><span class="method-args">(year, month, day)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Fetch the master scoreboard file Sample URL: <a
href="http://gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/master_scoreboard.xml">gd2.mlb.com/components/game/mlb/year_2008/month_04/day_07/master_scoreboard.xml</a>
</p>
        </div>
      </div>

      <div id="method-M000021" class="method-detail">
        <a name="M000021"></a>

        <div class="method-heading">
          <a href="GamedayFetcher.src/M000021.html" target="Code" class="method-signature"
            onclick="popupCode('GamedayFetcher.src/M000021.html');return false;">
          <span class="method-name">fetcher</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p>
Uncomment the <a href="GamedayFetcher.html#M000021">fetcher</a> that you
want to use
</p>
<pre>
  GamedayRemoteFetcher - gets data from remote url
  GamedayLocalFetcher - gets data from locally stored files
</pre>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>